<?xml version="1.0"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
 			xmlns:c="http://java.sun.com/jsp/jstl/core"
 			xmlns="http://www.w3.org/1999/xhtml"
 			version="2.1">
 
 <jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
 <jsp:directive.page isELIgnored="false" />
 <jsp:output 	omit-xml-declaration="false" 
 			 	doctype-root-element="HTML" 
 				doctype-system="about:legacy-compat" />
 
 <jsp:useBean id="datosLogin" class="es.javamyadmin.beans.LoginBean" scope="session" />
 
 <jsp:useBean id="listaTablesBean" class="es.javamyadmin.beans.ListaTablesBean" scope="session" />
 
 <jsp:setProperty property="user" name="listaTablesBean" value="${datosLogin.usuario}" />
 <jsp:setProperty property="pass" name="listaTablesBean" value="${datosLogin.password}" />
 <jsp:setProperty property="host" name="listaTablesBean" value="${datosLogin.servidor}" />
 <jsp:setProperty property="port" name="listaTablesBean" value="${datosLogin.puerto}" />
 <jsp:setProperty property="database" name="listaTablesBean" value="${param.bd}" />
 <jsp:setProperty property="table" name="listaTablesBean" value="${param.tabla}" />

<html>
<head>

<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/java-admin.css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/contenido-tablas.js"><!-- A --></script>
<title>JavaMyAdmin</title>

</head>

<body>

<div id="contenedor">
	<script id="respuesta">
	var dgrsd;
	</script>
	<jsp:include page="../includes/sidebar-left.jsp" />
	
	<div id="contenido">
	
		<jsp:include page="../includes/cabecera.jsp" />
		
		<h2>Database <c:out value="${param.bd}"></c:out></h2>
		
		<!-- Errores -->
		<c:if test="${error!=null}"><div class="aviso"><div class="pro_aviso ko"><p><c:out value="${error}"></c:out></p></div></div></c:if>
		
		<c:if test="${ok!=null}"><div class="aviso"><div class="pro_aviso ok"><p><c:out value="${ok}"></c:out></p></div></div></c:if>
		
		<table id="lista-tablas">		
		
			<c:forEach var="lista" items="${listaTablesBean.select}"  varStatus="estadoA">
				<tr>
					<c:forEach var="contenido" items="${lista.select}" varStatus="estadoB">
						<c:choose>
						
						<c:when test="${estadoA.index==0 }">
							<th><c:out value="${contenido.contenido }" default="a" /></th>
						</c:when>
						<c:otherwise>
							<td align="center"><span title="Doble click para editar" id="${estadoB.index },${estadoA.index}" ondblclick="dobleClick('${listaTablesBean.user}','${listaTablesBean.pass}','${listaTablesBean.host}','${listaTablesBean.port}','${listaTablesBean.database}','${listaTablesBean.table}','${estadoB.index}','${estadoA.index}')" ><c:out value="${contenido.contenido }" default="a" /></span></td>
						</c:otherwise>
						</c:choose>
					</c:forEach>
				</tr>
			</c:forEach>
			
	 	</table>
	 		
	</div>

</div>

</body>
</html>
</jsp:root>